home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr48
/
p_robo31.zip
/
MECHANIC.PR
< prev
next >
Wrap
Text File
|
1989-10-23
|
2KB
|
68 lines
(**************************************************************************)
(* W A R N I N G *)
(* *)
(* This Robot has NOT been designed to take advantage of the advanced *)
(* features of P-ROBOTS, such as, Shields, Fuel, Teams or Obstructions. *)
(**************************************************************************)
PROCEDURE Mechanic;
{ Based on a C-Robot By Bruce Oberleitner }
{ Sometimes, simplicity is best. This robot has absolutely }
{ no defense whatsoever!! It quickly locks onto a target }
{ and chases it around the playfield. It relies on the target }
{ going into a defensive mode while it stays on the ofensive. }
{ If the target is destroyed or it moves out of the scan area, }
{ a new target is selected and fired upon. }
VAR Range : Integer;
Angle : Integer;
PROCEDURE med_scan(scan_angle : Integer);
{ within 10 degrees of original scan angle }
VAR temp_angle : Integer;
res : Integer;
Inc : Integer;
BEGIN
temp_angle := scan_angle-5;
WHILE (temp_angle <= (scan_angle+30)) DO
BEGIN
Range := scan(temp_angle, 5); { scan 10 degree section }
drive(temp_angle, 50);
IF (Range <> 0) THEN
cannon(temp_angle, Range);
IF (Range = 0) THEN
temp_angle := temp_angle+5;
END; { while }
END; { end of med_scan }
PROCEDURE corse_scan(scan_angle : Integer);
BEGIN
WHILE True DO {Loop Forever}
BEGIN
Range := scan(scan_angle, 10);
IF (Range <> 0) THEN
BEGIN
cannon(scan_angle, Range); { take a real potshot }
drive(scan_angle, 50);
med_scan(scan_angle);
END;
scan_angle := scan_angle+20;
END;
END; { end of corse sub-program }
BEGIN {Mechanic Main}
Angle := Random(360);
corse_scan(Angle);
END; {end of Mechanic Main program }